package com.company.class7;

import java.util.Arrays;

/**
 * @Classname RegexTest
 * @Description 类型说明
 * @Date 2022/5/2 14:11
 * @Created by zbw
 */

public class RegexTest {
    public static void main(String[] args) {
        String origin = "[1,9,3,7,4,6,2,5,8,0]";
        System.out.println(origin);
//        String[] s = origin.split("\\[")[1].split("\\]")[0].split(",");
//        System.out.println(Arrays.toString(s));
//        for(int i=0;i<s.length;i=i+2){
//            origin = origin.replace(s[i],"x");
//            System.out.println(origin);
//        }


        //有没有就表示 1到5这么一个规则的含义：正则表达式。regular expression =》regex
        //这个正则表示 3前面不能有字符后面也不能有
        String s1 = "^3$";

        System.out.println(origin.replaceAll("[1-5]", "x"));
    }
}

